{% extends "admin/base.html" %}
{% block title %}-首页{% endblock %}
{% block index %}current-item{% endblock %}
{% block mainbody %}
    <div class="main">
        <center>
            <form id="form" method="post" action="/admin/index">
                添加评测：
                <input type="month" id="score_date" name="score_date" value="">
                <input type="submit" value="添加评测">
                <div class="error">{{ error }}</div>
            </form>

            <table class="table-user" border="1">
            <tr>
                <td>id</td>
                <td>评测时间</td>
                <td>状态</td>
                <td>操作</td>
                <td>操作</td>
            </tr>
            {% for item in data %}
                <tr>
                    <td>{{item.pk}}</td>
                    <td>{{item.fields.score_date}}</td>
                    {% ifequal item.fields.status True %}
                        <td class="current-item">正在评测</td>
                        <td><a href="/admin/stop_score">停止评测</a></td>
                        <td></td>
                    {% else %}
                        <td>已评测</td>
                        <td><a href="/admin/start_score?id={{ item.pk }}">重新打开评测</a></td>
                        <td><a href="/admin/delete_score?id={{ item.pk }}">删除评测</a></td>
                    {% endifequal %}
                </tr>
            {% endfor %}
            </table>

        </center>
    </div>

    <script>
        document.getElementById("score_date").value = new Date().getFullYear()+'-'+(new Date().getMonth()+1);
    </script>
{% endblock %}

